﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsApplication1
{
    public partial class F_KCYJ : Form
    {
        public F_KCYJ()
        {
            InitializeComponent();
          
        }

        SqlConnection conn;
        SqlCommand com;
        DataSet ds;
        SqlDataAdapter da;
        //SqlDataReader dr;
        public static string s1;
        public static string s2;

        
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            conn = new SqlConnection();
            conn.ConnectionString = SQL.getCon;
            com = new SqlCommand();
            com.CommandText = "select b.bm 药品编码,b.mc 药品名称,b.zdlsj 零售价,b.cbj 成本价,a.sjsl 库存数量,b.ykdw 单位 from ypkc a,ypgg b ,yptx c where a.ypid=b.ypid and c.bm=b.bm and c.yplx='西成药'";
            ds = new DataSet();
            da = new SqlDataAdapter();
            com.Connection = conn;
            da.SelectCommand = com;
            da.Fill(ds, "yp");
            dataGridView1.DataSource = ds.Tables["yp"];
        }

        private void toolStripButton2_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }


        private void toolStripButton3_Click_1(object sender, EventArgs e)
        {
            conn = new SqlConnection();
            conn.ConnectionString = SQL.getCon;
            com = new SqlCommand();
            com.CommandText = "select b.bm 药品编码,b.mc 药品名称,b.zdlsj 零售价,b.cbj 成本价,a.sjsl 库存数量,b.ykdw 单位 from ypkc a,ypgg b ,yptx c where a.ypid=b.ypid and c.bm=b.bm and c.yplx='中成药'";
            ds = new DataSet();
            da = new SqlDataAdapter();
            com.Connection = conn;
            da.SelectCommand = com;
            da.Fill(ds, "yp");
            dataGridView2.DataSource = ds.Tables["yp"];
        }


        private void toolStripButton4_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            conn = new SqlConnection();
            conn.ConnectionString = SQL.getCon;
            com = new SqlCommand();
            com.CommandText = "select b.bm 药品编码,b.mc 药品名称,b.zdlsj 零售价,b.cbj 成本价,a.sjsl 库存数量,b.ykdw 单位 from ypkc a,ypgg b ,yptx c where a.ypid=b.ypid and c.bm=b.bm and c.yplx='中草药'";
            ds = new DataSet();
            da = new SqlDataAdapter();
            com.Connection = conn;
            da.SelectCommand = com;
            da.Fill(ds, "yp");
            dataGridView3.DataSource = ds.Tables["yp"];
        }

        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        

        
        

        

  

      

 


    }
}